-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix type def reopening type from parent namespace #11208
Fix type def reopening type from parent namespace #11208
Conversation
@@ -383,6 +383,20 @@ describe "Semantic: class" do | |||
") { char } | |||
end | |||
|
|||
it "type def does not reopen type from parent namespace (#11181)" do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💭 "type def" is confusing because typedef
is a thing in the language. Maybe "type declaration" or just "class def" or "class declaration"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I took that term from the lookup_type_def
method. But yeah, I also thought it might be considered ambiguous.
A type declaration is var : Type
, so I don't think that's a better solution. class
works here, and I suppose we can use module
in the other spec (I didn't add specs for all kinds of types, but I think that's fine b/c the code is identical).
But it would be better to have a generic term for definitions of all kinds of types (class, struct, module, ...). And I think "type definition" is a natural solution for that with "type" being the abstraction for all kinds of types and it being a "definition".
If we go along with #10031 the term would be free from overloads =) For now, I'd propose to leave it as is. In this context, the meaning is unambiguous.
This is a bug fix which we could still merge for 1.12.0, but there's a non-dismissible chance for unforseen effects with such a change in the type grammar. This patch has been sitting for years, so there seems to be no rush to release it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's merge right after 1.12 is released, so we can have some time in nightly before releasing 1.13 and we don't push it forever.
Resolves #11181